<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #box{
            width: 100px;
            height: 100px;
            background-color: #fffdfd;
        }
    </style>
</head>
<body>
<div id="box" onmouseover="moveOver()" onmouseout="mouseOut()"></div>
<div id="box1"></div>
<div id="box2"></div>
</body>
<script>
    var moveIn=0;
    var moveOut=0;
    window.onload = function () {
        document.getElementById('box1').innerText=moveIn;
        document.getElementById('box2').innerText=moveOut;

    }
    function moveOver() {
        moveIn+=1;
        document.getElementById('box1').innerText=moveIn;
    }
    function moveOut() {
        moveOut+=1;
        document.getElementById('box2').innerText=moveOut;
    }
</script>
</html>